/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package sv.com.dizucar.modelo;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author 43579648
 */
@Entity
@Table(name = "CLIENTE_POTENCIAL", catalog = "", schema = "DIZUCAR")
@NamedQueries({
    @NamedQuery(name = "ClientePotencial.findAll", query = "SELECT c FROM ClientePotencial c"),
    @NamedQuery(name = "ClientePotencial.findByIdclientepotencial", query = "SELECT c FROM ClientePotencial c WHERE c.idclientepotencial = :idclientepotencial"),
    @NamedQuery(name = "ClientePotencial.findByFechaseguimiento", query = "SELECT c FROM ClientePotencial c WHERE c.fechaseguimiento = :fechaseguimiento"),
    @NamedQuery(name = "ClientePotencial.findByAsignadoa", query = "SELECT c FROM ClientePotencial c WHERE c.asignadoa = :asignadoa")})
public class ClientePotencial implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "IDCLIENTEPOTENCIAL", nullable = false, length = 200)
    private String idclientepotencial;
    @Basic(optional = false)
    @Column(name = "FECHASEGUIMIENTO", nullable = false)
    private long fechaseguimiento;
    @Basic(optional = false)
    @Column(name = "ASIGNADOA", nullable = false, length = 40)
    private String asignadoa;
    @JoinColumn(name = "IDCLIENTE", referencedColumnName = "IDCLIENTE", nullable = false)
    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    private Cliente cliente;

    public ClientePotencial() {
    }

    public ClientePotencial(String idclientepotencial) {
        this.idclientepotencial = idclientepotencial;
    }

    public ClientePotencial(String idclientepotencial, long fechaseguimiento, String asignadoa) {
        this.idclientepotencial = idclientepotencial;
        this.fechaseguimiento = fechaseguimiento;
        this.asignadoa = asignadoa;
    }

    public String getIdclientepotencial() {
        return idclientepotencial;
    }

    public void setIdclientepotencial(String idclientepotencial) {
        this.idclientepotencial = idclientepotencial;
    }

    public long getFechaseguimiento() {
        return fechaseguimiento;
    }

    public void setFechaseguimiento(long fechaseguimiento) {
        this.fechaseguimiento = fechaseguimiento;
    }

    public String getAsignadoa() {
        return asignadoa;
    }

    public void setAsignadoa(String asignadoa) {
        this.asignadoa = asignadoa;
    }

    public Cliente getCliente() {
        return cliente;
    }

    public void setCliente(Cliente cliente) {
        this.cliente = cliente;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idclientepotencial != null ? idclientepotencial.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ClientePotencial)) {
            return false;
        }
        ClientePotencial other = (ClientePotencial) object;
        if ((this.idclientepotencial == null && other.idclientepotencial != null) || (this.idclientepotencial != null && !this.idclientepotencial.equals(other.idclientepotencial))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "sv.com.dizucar.modelo.ClientePotencial[idclientepotencial=" + idclientepotencial + "]";
    }

}
